/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Ron
 */
@Entity
@Table(name = "F_MODELER")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FModeler.findAll", query = "SELECT f FROM FModeler f"),
    @NamedQuery(name = "FModeler.findByMRNo", query = "SELECT f FROM FModeler f WHERE f.mRNo = :mRNo"),
    @NamedQuery(name = "FModeler.findByMRIntitule", query = "SELECT f FROM FModeler f WHERE f.mRIntitule = :mRIntitule"),
    @NamedQuery(name = "FModeler.findByCbProt", query = "SELECT f FROM FModeler f WHERE f.cbProt = :cbProt"),
    @NamedQuery(name = "FModeler.findByCbMarq", query = "SELECT f FROM FModeler f WHERE f.cbMarq = :cbMarq"),
    @NamedQuery(name = "FModeler.findByCbCreateur", query = "SELECT f FROM FModeler f WHERE f.cbCreateur = :cbCreateur"),
    @NamedQuery(name = "FModeler.findByCbModification", query = "SELECT f FROM FModeler f WHERE f.cbModification = :cbModification"),
    @NamedQuery(name = "FModeler.findByCbReplication", query = "SELECT f FROM FModeler f WHERE f.cbReplication = :cbReplication"),
    @NamedQuery(name = "FModeler.findByCbFlag", query = "SELECT f FROM FModeler f WHERE f.cbFlag = :cbFlag")})
public class FModeler implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "MR_No")
    private int mRNo;
    @Column(name = "MR_Intitule")
    private String mRIntitule;
    @Lob
    @Column(name = "cbMR_Intitule")
    private byte[] cbMRIntitule;
    @Column(name = "cbProt")
    private Short cbProt;
    @Id
    @Basic(optional = false)
    @Column(name = "cbMarq")
    private Integer cbMarq;
    @Column(name = "cbCreateur")
    private String cbCreateur;
    @Column(name = "cbModification")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cbModification;
    @Column(name = "cbReplication")
    private Integer cbReplication;
    @Column(name = "cbFlag")
    private Short cbFlag;
    @OneToMany(mappedBy = "cbMRNo")
    private Collection<FComptet> fComptetCollection;

    public FModeler() {
    }

    public FModeler(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public FModeler(Integer cbMarq, int mRNo) {
        this.cbMarq = cbMarq;
        this.mRNo = mRNo;
    }

    public int getMRNo() {
        return mRNo;
    }

    public void setMRNo(int mRNo) {
        this.mRNo = mRNo;
    }

    public String getMRIntitule() {
        return mRIntitule;
    }

    public void setMRIntitule(String mRIntitule) {
        this.mRIntitule = mRIntitule;
    }

    public byte[] getCbMRIntitule() {
        return cbMRIntitule;
    }

    public void setCbMRIntitule(byte[] cbMRIntitule) {
        this.cbMRIntitule = cbMRIntitule;
    }

    public Short getCbProt() {
        return cbProt;
    }

    public void setCbProt(Short cbProt) {
        this.cbProt = cbProt;
    }

    public Integer getCbMarq() {
        return cbMarq;
    }

    public void setCbMarq(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public String getCbCreateur() {
        return cbCreateur;
    }

    public void setCbCreateur(String cbCreateur) {
        this.cbCreateur = cbCreateur;
    }

    public Date getCbModification() {
        return cbModification;
    }

    public void setCbModification(Date cbModification) {
        this.cbModification = cbModification;
    }

    public Integer getCbReplication() {
        return cbReplication;
    }

    public void setCbReplication(Integer cbReplication) {
        this.cbReplication = cbReplication;
    }

    public Short getCbFlag() {
        return cbFlag;
    }

    public void setCbFlag(Short cbFlag) {
        this.cbFlag = cbFlag;
    }

    @XmlTransient
    public Collection<FComptet> getFComptetCollection() {
        return fComptetCollection;
    }

    public void setFComptetCollection(Collection<FComptet> fComptetCollection) {
        this.fComptetCollection = fComptetCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cbMarq != null ? cbMarq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FModeler)) {
            return false;
        }
        FModeler other = (FModeler) object;
        if ((this.cbMarq == null && other.cbMarq != null) || (this.cbMarq != null && !this.cbMarq.equals(other.cbMarq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.FModeler[ cbMarq=" + cbMarq + " ]";
    }
    
}
